package com.andkrup.easygame.events {
	import flash.events.Event;
	
	/**
	 * @author Andkrup
	 */
	public class ExternalModuleErrorEvent extends Event {
		public static const ACTIVATE_ERROR:String = "activate error";
		public var moduleName:String;
		private var error:Error;
		
		public function get message():String{
			return error.message;
		}

		public function ExternalModuleErrorEvent(type:String, moduleName:String, error:Error, bubbles:Boolean = false, cancelable:Boolean = false) {
			super(type, bubbles, cancelable);
			this.moduleName = moduleName;
			this.error = error;
		}

		public function getStackTrace():String{
			return error.getStackTrace();
		}
		
		public override function clone():Event{
			return new ExternalModuleErrorEvent(type, moduleName, error, bubbles, cancelable);
		}
	}
}
